<?php /* Smarty version 2.6.18, created on 2015-12-03 18:01:37
         compiled from dataViewToday.html */ ?>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "header.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "top.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "left.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>

<div class="main-content">
	
	<div class="breadcrumbs" id="breadcrumbs">
						<script type="text/javascript">
							try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
						</script>

						<ul class="breadcrumb">
	<li><i class="icon-home home-icon"></i> <a
		href="index.php">首页</a></li>
</ul>
	</div>
	

<div class="page-content">

<div id="pcDevice" style="display:block" class="col-xs-12">

<!--  
<div class="alert alert-block alert-success">
   
								<button type="button" class="close" data-dismiss="alert">
										<i class="icon-remove"></i>
								</button>

									<i class="icon-hand-right"></i>温馨提示
									<strong class="green">
										因数据量较大,实时数据查询耗时较长,每查询一天的数据大约需要8秒,请您耐心等...
									</strong>

</div>
-->

<div class="alert alert-info">
<form class="form-horizontal" role="form">
<div class="row">

<div class="col-sm-2">
<div class="row">
<label class="col-sm-2 control-label no-padding-right" for="form-field-5">游戏</label>
<div class="col-sm-6"><select  id="selectGame">
	<option value="" >游戏</option>
	<?php if ($this->_tpl_vars['selectGames']): ?> <?php $_from = $this->_tpl_vars['selectGames']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['value']):
?>
	<?php if ($this->_tpl_vars['nowGame'] == $this->_tpl_vars['value']): ?>
	<option value="<?php echo $this->_tpl_vars['value']; ?>
" selected><?php echo $this->_tpl_vars['value']; ?>
</option>
	<?php else: ?>
	<option value="<?php echo $this->_tpl_vars['value']; ?>
"><?php echo $this->_tpl_vars['value']; ?>
</option>
	<?php endif; ?> <?php endforeach; endif; unset($_from); ?> <?php endif; ?>
</select>
</div>
</div>
</div>

<div class="col-sm-3">
<div class="row">
<label class="col-sm-2 control-label no-padding-right" for="form-field-5">平台</label>
<div class="col-sm-3">
<select id="platform">
	<option value="" id="selectPlatform">平台</option>
	<?php if ($this->_tpl_vars['platforms']): ?> <?php $_from = $this->_tpl_vars['platforms']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['value']):
?>
	<?php if ($this->_tpl_vars['platform'] == $this->_tpl_vars['value']): ?>
	<option value="<?php echo $this->_tpl_vars['value']; ?>
" selected><?php echo $this->_tpl_vars['value']; ?>
</option>
	<?php else: ?>
	<option value="<?php echo $this->_tpl_vars['value']; ?>
"><?php echo $this->_tpl_vars['value']; ?>
</option>
	<?php endif; ?> <?php endforeach; endif; unset($_from); ?> <?php endif; ?>
</select>
</div>

<label class="col-sm-3 control-label no-padding-right" for="form-field-5">渠道</label>
<div class="col-sm-3">
<select  id="channel">
	<option value="" id="selectChannel">渠道</option>
		<?php if ($this->_tpl_vars['channels']): ?> <?php $_from = $this->_tpl_vars['channels']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['value']):
?>
	<?php if ($this->_tpl_vars['channel'] == $this->_tpl_vars['value']): ?>
	<option value="<?php echo $this->_tpl_vars['value']; ?>
" selected><?php echo $this->_tpl_vars['value']; ?>
</option>
	<?php else: ?>
	<option value="<?php echo $this->_tpl_vars['value']; ?>
"><?php echo $this->_tpl_vars['value']; ?>
</option>
	<?php endif; ?> <?php endforeach; endif; unset($_from); ?> <?php endif; ?>
</select>
</div>
</div>
</div>

<div class="col-sm-2">
<div class="row">
<label class="col-sm-2 control-label no-padding-right" for="form-field-5">存储</label>
<div class="col-sm-6">
	<input style="margin-top:10px;" name="form-field-radio3" id ="backFile" type="radio" <?php if ($this->_tpl_vars['statistics'] && $this->_tpl_vars['statistics'] == 1): ?>checked <?php endif; ?> value = "1" class="ace"/>
	<span class="lbl">yes</span>
	<br/>
	<input name="form-field-radio3" id ="backFile" type="radio"   value = "0" <?php if ($this->_tpl_vars['statistics'] == 0): ?> checked <?php endif; ?>  class="ace" />
	<span class="lbl">no</span>
</div>
</div>
</div>


<div class="col-sm-2">
<div class="row"><label
	class="col-sm-2 control-label no-padding-right" for="form-field-5">开始</label>
<div class="col-sm-8">
<div class="input-group"><span class="input-group-addon"> <i
	class="icon-calendar bigger-110"></i> </span> <input
	class="date-picker col-xs-12 col-sm-12" id="startTime"
	value="<?php echo $this->_tpl_vars['startDate']; ?>
" type="text" data-date-format="yyyy-mm-dd" /></div>
</div>
</div>
</div>

<div class="col-sm-2">
<div class="row"><label
	class="col-sm-2 control-label no-padding-right" for="form-field-5">结束</label>
<div class="col-sm-8">
<div class="input-group"><span class="input-group-addon"> <i
	class="icon-calendar bigger-110"></i> </span> <input
	class="date-picker col-xs-12 col-sm-12" id="endTime"
	value="<?php echo $this->_tpl_vars['endDate']; ?>
" type="text" data-date-format="yyyy-mm-dd" /></div>
</div>
</div>
</div>


<div class="col-sm-1">
<div class="col-sm-9">
<center>
<button type="button" onClick="formSubmit('pc');"
	class="width-10 btn btn-sm btn-primary">查询</button>

</center>
</div>
</div>
</div>

</div>
</form>
</div>


<div id="moveDevice" style="display:none" class="col-xs-12">
<div class="alert alert-block alert-success">
   
									<button type="button" class="close" data-dismiss="alert">
										<i class="icon-remove"></i>
								</button>

									<i class="icon-hand-right"></i>温馨提示
									<strong class="green">
										因数据量较大,实时数据查询耗时较长,每查询一天的数据大约需要8秒,请您耐心等...
									<!--   	 <strong class="green" id="execIngLogTips">正在查询...</strong><strong class="red" id="execIngLogUsedTime"></strong>
									-->
									</strong>

</div>

<div class="alert alert-info">
<form class="form-horizontal" role="form">
<div class="row">

<div class="col-sm-12">
<div class="row">
<label class="col-sm-5 control-label no-padding-right" for="form-field-5">游戏</label>
<div class="col-sm-6"><select  id="selectGame2">
	<option value="" >游戏</option>
	<?php if ($this->_tpl_vars['selectGames']): ?> <?php $_from = $this->_tpl_vars['selectGames']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['value']):
?>
	<?php if ($this->_tpl_vars['nowGame'] == $this->_tpl_vars['value']): ?>
	<option value="<?php echo $this->_tpl_vars['value']; ?>
" selected><?php echo $this->_tpl_vars['value']; ?>
</option>
	<?php else: ?>
	<option value="<?php echo $this->_tpl_vars['value']; ?>
"><?php echo $this->_tpl_vars['value']; ?>
</option>
	<?php endif; ?> <?php endforeach; endif; unset($_from); ?> <?php endif; ?>
</select>

</div>
</div>
</div>



<div class="col-sm-12">
<div  class="row">
<label class="col-sm-5 control-label no-padding-right" for="form-field-5"></label>
</div>
</div>

<div class="col-sm-12">
<div class="row">
<label class="col-sm-5 control-label no-padding-right" for="form-field-5">平台</label>
<div class="col-sm-3">
<select id="platform2">
	<option value="" id="selectPlatform2">平台</option>
	<?php if ($this->_tpl_vars['platforms']): ?> <?php $_from = $this->_tpl_vars['platforms']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['value']):
?>
	<?php if ($this->_tpl_vars['platform'] == $this->_tpl_vars['value']): ?>
	<option value="<?php echo $this->_tpl_vars['value']; ?>
" selected><?php echo $this->_tpl_vars['value']; ?>
</option>
	<?php else: ?>
	<option value="<?php echo $this->_tpl_vars['value']; ?>
"><?php echo $this->_tpl_vars['value']; ?>
</option>
	<?php endif; ?> <?php endforeach; endif; unset($_from); ?> <?php endif; ?>
</select>
</div>
</div>
</div>

<div class="col-sm-12">
<div  class="row">
<label class="col-sm-5 control-label no-padding-right" for="form-field-5"></label>
</div>
</div>

<div class="col-sm-12">
<div class="row">
<label class="col-sm-5 control-label no-padding-right" for="form-field-5">渠道</label>
<div class="col-sm-5">
<select  id="channel2">
	<option value="" id="selectChannel2">渠道</option>
		<?php if ($this->_tpl_vars['channels']): ?> <?php $_from = $this->_tpl_vars['channels']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['value']):
?>
	<?php if ($this->_tpl_vars['channel'] == $this->_tpl_vars['value']): ?>
	<option value="<?php echo $this->_tpl_vars['value']; ?>
" selected><?php echo $this->_tpl_vars['value']; ?>
</option>
	<?php else: ?>
	<option value="<?php echo $this->_tpl_vars['value']; ?>
"><?php echo $this->_tpl_vars['value']; ?>
</option>
	<?php endif; ?> <?php endforeach; endif; unset($_from); ?> <?php endif; ?>
</select>
</div>
</div>
</div>


<div class="col-sm-12">
<div  class="row">
<label class="col-sm-5 control-label no-padding-right" for="form-field-5"></label>
</div>
</div>

<div class="col-sm-12">
<div class="row">
<label class="col-sm-5 control-label no-padding-right" for="form-field-5">存储</label>
<div class="col-sm-6">
	<input style="margin-top:10px;" name="form-field-radio32" id ="backFile" type="radio" <?php if ($this->_tpl_vars['statistics'] && $this->_tpl_vars['statistics'] == 1): ?>checked <?php endif; ?> value = "1" class="ace"/>
	<span class="lbl">yes</span>
	<br/>
	<input name="form-field-radio32" id ="backFile" type="radio"   value = "0" <?php if ($this->_tpl_vars['statistics'] == 0): ?> checked <?php endif; ?>  class="ace" />
	<span class="lbl">no</span>
</div>
</div>
</div>

<div class="col-sm-12">
<div  class="row">
<label class="col-sm-5 control-label no-padding-right" for="form-field-5"></label>
</div>
</div>

<div class="col-sm-12">
<div class="row"><label
	class="col-sm-5 control-label no-padding-right" for="form-field-5">开始</label>
<div class="col-sm-3">
<div class="input-group"><span class="input-group-addon"> <i
	class="icon-calendar bigger-110"></i> </span> <input
	class="date-picker col-xs-12 col-sm-12" id="startTime2"
	value="<?php echo $this->_tpl_vars['startDate']; ?>
" type="text" data-date-format="yyyy-mm-dd" /></div>
</div>
</div>
</div>

<div class="col-sm-12">
<div  class="row">
<label class="col-sm-5 control-label no-padding-right" for="form-field-5"></label>
</div>
</div>


<div class="col-sm-12">
<div class="row"><label
	class="col-sm-5 control-label no-padding-right" for="form-field-5">结束</label>
<div class="col-sm-3">
<div class="input-group"><span class="input-group-addon"> <i
	class="icon-calendar bigger-110"></i> </span> <input
	class="date-picker col-xs-12 col-sm-12" id="endTime2"
	value="<?php echo $this->_tpl_vars['endDate']; ?>
" type="text" data-date-format="yyyy-mm-dd" /></div>
</div>
</div>
</div>

<div class="col-sm-12">
<div  class="row">
<label class="col-sm-5 control-label no-padding-right" for="form-field-5"></label>
</div>
</div>

<div class="col-sm-12">

<label
	class="col-sm-5 control-label no-padding-right" for="form-field-5"></label>
<div class="col-sm-2">	
<center>
<button type="button" onClick="formSubmit('move');"
	class="width-10 btn btn-sm btn-primary">查询</button>

</center>
</div>
</div>
</div>

</div>
</form>
</div>




<div class="col-xs-12">
<div class="table-header">

<button type="button" onClick="view1();"
	class="width-10 btn btn-sm btn-primary">基础信息
</button>

<button type="button" onClick="view2();"
	class="width-10 btn btn-sm btn-primary">付费数据
</button>

<button type="button" onClick="view3();"
	class="width-10 btn btn-sm btn-primary">留存数据
</button>

<?php if ($this->_tpl_vars['viewAll'] && $this->_tpl_vars['viewAll'] == 1): ?>
<button type="button" onClick="viewAll();"
	class="width-10 btn btn-sm btn-primary">显示全部
</button>
<?php endif; ?>

<button id="pcDevice2" type="button" style="float:right;display:none" onClick="formSubmitExportExcel('pc');"
	class="width-10 btn btn-sm btn-primary">导出excel
</button>

<button id="moveDevice2"  type="button" style="float:right;display:none" onClick="formSubmitExportExcel('move');"
	class="width-10 btn btn-sm btn-primary">导出excel
</button>

</div>

<div id="viewAll"  style="display:none" class="table-responsive">
<table id="sample-table-1"
	class="table table-striped table-bordered table-hover">
	<thead>
		<tr style="color:red">
		<td colspan="16">基础属性</td>
		<td colspan="4">ARP相关</td>
		<td colspan="5">基础信息</td>
		<td colspan="5">付费信息</td>
		<td colspan="5">LTV信息</td>		
		</tr>
		
		<tr>
			<th>游戏</th>
			<th>平台</th>
			<th>渠道</th>
			<th>日期</th>

			<th>总用户</th>
			<th>新增用户</th>
			<th>总设备</th>
			<th>新增设备</th>

			<th>日活跃用户</th>
			<th>日活跃设备</th>
			
			<th>总付费用户</th>
			<th>当日新增新增付费用户 </th>
			<th>总付费设备</th>
			<th>当日新增付费设备</th>
			<th>总付费金额</th>
			<th>当日新增付费金额</th>

			<th>ARPU</th>
			<th>ARPD</th>
			<th>ARPPU</th>
			<th>付费率</th>


			<th>次日</th>
			<th>3日</th>
			<th>7日</th>
			<th>14日</th>
			<th>30日</th>
			
			<th>次日</th>
			<th>3日</th>
			<th>7日</th>
			<th>14日</th>
			<th>30日</th>
			
			<th>次日</th>
			<th>3日</th>
			<th>7日</th>
			<th>14日</th>
			<th>30日</th>

		</tr>
	<thead>
	<thead>
	<tbody>
		<?php $_from = $this->_tpl_vars['data']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['data']):
?>
		<tr>
			<td><?php echo $this->_tpl_vars['data']['game']; ?>
</td>
			<td><?php echo $this->_tpl_vars['data']['platform']; ?>
</td>
			<td><?php echo $this->_tpl_vars['data']['channel']; ?>
</td>
			<td><?php echo $this->_tpl_vars['data']['date']; ?>
</td>

			<td><?php echo $this->_tpl_vars['data']['totalUser']; ?>
</td>
			<td><?php echo $this->_tpl_vars['data']['newUser']; ?>
</td>
			<td><?php echo $this->_tpl_vars['data']['totalDevice']; ?>
</td>
			<td><?php echo $this->_tpl_vars['data']['newDevice']; ?>
</td>

			<td><?php echo $this->_tpl_vars['data']['userLogin']; ?>
</td>
			<td><?php echo $this->_tpl_vars['data']['deviceLogin']; ?>
</td>
		
			<td><?php echo $this->_tpl_vars['data']['totalPayUser']; ?>
</td>
			<td><?php echo $this->_tpl_vars['data']['payUser']; ?>
</td>
			<td><?php echo $this->_tpl_vars['data']['totalPayDevice']; ?>
</td>
			<td><?php echo $this->_tpl_vars['data']['payDevice']; ?>
</td>
			<td><?php echo $this->_tpl_vars['data']['totalPayMoney']; ?>
</td>
			<td><?php echo $this->_tpl_vars['data']['payMoney']; ?>
</td>

			<td><?php echo $this->_tpl_vars['data']['ARPU']; ?>
</td>
			<td><?php echo $this->_tpl_vars['data']['ARPD']; ?>
</td>
			<td><?php echo $this->_tpl_vars['data']['ARPPU']; ?>
</td>
			<td><?php echo $this->_tpl_vars['data']['PayRate']; ?>
</td>

			<td><?php echo $this->_tpl_vars['data']['LTV2']; ?>
</td>
			<td><?php echo $this->_tpl_vars['data']['LTV3']; ?>
</td>
			<td><?php echo $this->_tpl_vars['data']['LTV7']; ?>
</td>
			<td><?php echo $this->_tpl_vars['data']['LTV14']; ?>
</td>
			<td><?php echo $this->_tpl_vars['data']['LTV30']; ?>
</td>
				
			<td><?php echo $this->_tpl_vars['data']['userRetention2']; ?>
</td>
			<td><?php echo $this->_tpl_vars['data']['userRetention3']; ?>
</td>
			<td><?php echo $this->_tpl_vars['data']['userRetention7']; ?>
</td>
			<td><?php echo $this->_tpl_vars['data']['userRetention14']; ?>
</td>
			<td><?php echo $this->_tpl_vars['data']['userRetention30']; ?>
</td>

			<td><?php echo $this->_tpl_vars['data']['deviceRetention2']; ?>
</td>
			<td><?php echo $this->_tpl_vars['data']['deviceRetention3']; ?>
</td>
			<td><?php echo $this->_tpl_vars['data']['deviceRetention7']; ?>
</td>
			<td><?php echo $this->_tpl_vars['data']['deviceRetention14']; ?>
</td>
			<td><?php echo $this->_tpl_vars['data']['deviceRetention30']; ?>
</td>
		</tr>
		<?php endforeach; endif; unset($_from); ?>

	</tbody>
</table>
</div>

<div id="view1" class="table-responsive">
<table id="sample-table-2"
	class="table table-striped table-bordered table-hover">
	<thead>
		<tr>
			<th>游戏</th>
			<th>平台</th>
			<th>渠道</th>
			<th>日期</th>
			
			<th>新增用户</th>
			<th>新增设备</th>
			<th>日活跃用户</th>
			<th>日活跃设备</th>		
			
			<th>当日新增付费用户 </th>
			<th>当日新增付费设备</th>
			<th>当日新增付费金额</th>
			
			<th>总用户</th>
			<th>总设备</th>
			<th>总付费用户</th>
			<th>总付费设备</th>
			<th>总付费金额</th>
			
			<th>ARPU</th>
			<th>ARPD</th>
			<th>ARPPU</th>
			<th>付费率</th>

		</tr>
	<thead>
	<thead>
	<tbody>
		<?php $_from = $this->_tpl_vars['data2']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['data']):
?>
		<tr>
	<td><?php echo $this->_tpl_vars['data']['game']; ?>
</td>
			<td><?php echo $this->_tpl_vars['data']['platform']; ?>
</td>
			<td><?php echo $this->_tpl_vars['data']['channel']; ?>
</td>
			<td><?php echo $this->_tpl_vars['data']['date']; ?>
</td>
			
			<td><?php echo $this->_tpl_vars['data']['newUser']; ?>
</td>
			<td><?php echo $this->_tpl_vars['data']['newDevice']; ?>
</td>
			<td><?php echo $this->_tpl_vars['data']['userLogin']; ?>
</td>
			<td><?php echo $this->_tpl_vars['data']['deviceLogin']; ?>
</td>
			
			<td><?php echo $this->_tpl_vars['data']['payUser']; ?>
</td>
			<td><?php echo $this->_tpl_vars['data']['payDevice']; ?>
</td>
			<td><?php echo $this->_tpl_vars['data']['payMoney']; ?>
</td>
			
			<td><?php echo $this->_tpl_vars['data']['totalUser']; ?>
</td>
			<td><?php echo $this->_tpl_vars['data']['totalDevice']; ?>
</td>
			<td><?php echo $this->_tpl_vars['data']['totalPayUser']; ?>
</td>
			<td><?php echo $this->_tpl_vars['data']['totalPayDevice']; ?>
</td>
			<td><?php echo $this->_tpl_vars['data']['totalPayMoney']; ?>
</td>
			
			<td><?php echo $this->_tpl_vars['data']['ARPU']; ?>
</td>
			<td><?php echo $this->_tpl_vars['data']['ARPD']; ?>
</td>
			<td><?php echo $this->_tpl_vars['data']['ARPPU']; ?>
</td>
			<td><?php echo $this->_tpl_vars['data']['PayRate']; ?>
</td>
		</tr>
		<?php endforeach; endif; unset($_from); ?>

	</tbody>
</table>
</div>

<div id="view2" style="display:none" class="table-responsive">
<table id="sample-table-3"
	class="table table-striped table-bordered table-hover">
	<thead>
	

	<tr style="color:red">
		<center>
			<th align=center  colspan="4" >查询条件</th>
			<th align=center   colspan="6" >基础信息</th>
			<th align=center   colspan="4" >付费信息</th>
			<th align=center    colspan="5" >LTV信息</th>
		</center>	
		</tr>
	
		<tr>
			<th>游戏</th>
			<th>平台</th>
			<th>渠道</th>
			<th>日期</th>
			
			<th>当日新增付费用户 </th> 
			<th>当日新增付费设备</th>
			<th>当日新增付费金额</th>  
			<th>总付费用户</th>   
			<th>总付费设备</th>  
			<th>总付费金额</th>   

			<th>ARPU</th>
			<th>ARPD</th>
			<th>ARPPU</th>
			<th>付费率</th>
			
			
			<th>次日</th>
			<th>3日</th>
			<th>7日</th>
			<th>14日</th>
			<th>30日</th>

		</tr>
	<thead>
	<thead>
	<tbody>
		<?php $_from = $this->_tpl_vars['data3']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['data']):
?>
		<tr>
			<td><?php echo $this->_tpl_vars['data']['game']; ?>
</td>
			<td><?php echo $this->_tpl_vars['data']['platform']; ?>
</td>
			<td><?php echo $this->_tpl_vars['data']['channel']; ?>
</td>
			<td><?php echo $this->_tpl_vars['data']['date']; ?>
</td>	

			<td><?php echo $this->_tpl_vars['data']['payUser']; ?>
</td>
			<td><?php echo $this->_tpl_vars['data']['payDevice']; ?>
</td>
			<td><?php echo $this->_tpl_vars['data']['payMoney']; ?>
</td>
			<td><?php echo $this->_tpl_vars['data']['totalPayUser']; ?>
</td>
			<td><?php echo $this->_tpl_vars['data']['totalPayDevice']; ?>
</td>
			<td><?php echo $this->_tpl_vars['data']['totalPayMoney']; ?>
</td>
			

			<td><?php echo $this->_tpl_vars['data']['ARPU']; ?>
</td>
			<td><?php echo $this->_tpl_vars['data']['ARPD']; ?>
</td>
			<td><?php echo $this->_tpl_vars['data']['ARPPU']; ?>
</td>
			<td><?php echo $this->_tpl_vars['data']['PayRate']; ?>
</td>
			
			<td><?php echo $this->_tpl_vars['data']['LTV2']; ?>
</td>
			<td><?php echo $this->_tpl_vars['data']['LTV3']; ?>
</td>
			<td><?php echo $this->_tpl_vars['data']['LTV7']; ?>
</td>
			<td><?php echo $this->_tpl_vars['data']['LTV14']; ?>
</td>
			<td><?php echo $this->_tpl_vars['data']['LTV30']; ?>
</td>
		</tr>
		<?php endforeach; endif; unset($_from); ?>

	</tbody>
</table>
</div>


<div id="view3" style="display:none" class="table-responsive">
<table id="sample-table-4"
	class="table table-striped table-bordered table-hover">
	<thead>
	

		<tr style="color:red">
			<th align=center  colspan="4" >查询条件</th>
			<th align=center   colspan="6" >基础信息</th>
			<th align=center   colspan="5" >用户留存</th>
			<th align=center    colspan="5" >设备留存</th>
		</tr>
	
		<tr>
			<th>游戏</th>
			<th>平台</th>
			<th>渠道</th>
			<th>日期</th>

			<th>新增用户</th>  
			<th>新增设备</th>
			<th>日活跃用户</th>
			<th>日活跃设备</th>
			<th>总用户</th>
			<th>总设备</th>	
			
			<th>次日</th>
			<th>3日</th>
			<th>7日</th>
			<th>14日</th>
			<th>30日</th>
			
			<th>次日</th>
			<th>3日</th>
			<th>7日</th>
			<th>14日</th>
			<th>30日</th>

		</tr>
	<thead>
	<thead>
	<tbody>
		<?php $_from = $this->_tpl_vars['data4']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['data']):
?>
		<tr>
			<td><?php echo $this->_tpl_vars['data']['game']; ?>
</td>
			<td><?php echo $this->_tpl_vars['data']['platform']; ?>
</td>
			<td><?php echo $this->_tpl_vars['data']['channel']; ?>
</td>
			<td><?php echo $this->_tpl_vars['data']['date']; ?>
</td>	
			
			<td><?php echo $this->_tpl_vars['data']['newUser']; ?>
</td>
			<td><?php echo $this->_tpl_vars['data']['newDevice']; ?>
</td>
			<td><?php echo $this->_tpl_vars['data']['userLogin']; ?>
</td>
			<td><?php echo $this->_tpl_vars['data']['deviceLogin']; ?>
</td>
			<td><?php echo $this->_tpl_vars['data']['totalUser']; ?>
</td>
			<td><?php echo $this->_tpl_vars['data']['totalDevice']; ?>
</td>
				
			<td><?php echo $this->_tpl_vars['data']['userRetention2']; ?>
</td>
			<td><?php echo $this->_tpl_vars['data']['userRetention3']; ?>
</td>
			<td><?php echo $this->_tpl_vars['data']['userRetention7']; ?>
</td>
			<td><?php echo $this->_tpl_vars['data']['userRetention14']; ?>
</td>
			<td><?php echo $this->_tpl_vars['data']['userRetention30']; ?>
</td>

			<td><?php echo $this->_tpl_vars['data']['deviceRetention2']; ?>
</td>
			<td><?php echo $this->_tpl_vars['data']['deviceRetention3']; ?>
</td>
			<td><?php echo $this->_tpl_vars['data']['deviceRetention7']; ?>
</td>
			<td><?php echo $this->_tpl_vars['data']['deviceRetention14']; ?>
</td>
			<td><?php echo $this->_tpl_vars['data']['deviceRetention30']; ?>
</td>
		</tr>
		<?php endforeach; endif; unset($_from); ?>

	</tbody>
</table>
</div>


<!-- /.table-responsive --></div>
</div>
<!-- /.page-content -->
</div>

<script type="text/javascript">

	function view1() {
		$('#view1').css("display", "block");
		$('#view2').css("display", "none");
		$('#view3').css("display", "none");
		$('#viewAll').css("display", "none");
	}

	function view2() {
		$('#view1').css("display", "none");
		$('#view2').css("display", "block");
		$('#view3').css("display", "none");
		$('#viewAll').css("display", "none");
	}
	
	function view3() {
		$('#view1').css("display", "none");
		$('#view2').css("display", "none");
		$('#view3').css("display", "block");
		$('#viewAll').css("display", "none");
	}
	
	function viewAll() {
		$('#view1').css("display", "none");
		$('#view2').css("display", "none");
		$('#view3').css("display", "none");
		$('#viewAll').css("display", "block");
	}

	jQuery(function($) {
		$('.date-picker').datepicker({
			autoclose : true
		}).next().on(ace.click_event, function() {
			$(this).prev().focus();
		});

		var oTable1 = $('#sample-table-1').dataTable({
			"aoColumns" : [ {
				"bSortable" : false
			}, {
				"bSortable" : false
			}, {
				"bSortable" : false
			}, {
				"bSortable" : false
			}, {
				"bSortable" : false
			}, {
				"bSortable" : false
			}, {
				"bSortable" : false
			}, {
				"bSortable" : false
			}, {
				"bSortable" : false
			}, {
				"bSortable" : false
			}, {
				"bSortable" : false
			}, {
				"bSortable" : false
			}, {
				"bSortable" : false
			}, {
				"bSortable" : false
			}, {
				"bSortable" : false
			}, {
				"bSortable" : false
			}, {
				"bSortable" : false
			}, {
				"bSortable" : false
			}, {
				"bSortable" : false
			}, {
				"bSortable" : false
			}, {
				"bSortable" : false
			}, {
				"bSortable" : false
			}, {
				"bSortable" : false
			}, {
				"bSortable" : false
			}, {
				"bSortable" : false
			}, {
				"bSortable" : false
			}, {
				"bSortable" : false
			}, {
				"bSortable" : false
			}, {
				"bSortable" : false
			}, {
				"bSortable" : false
			}, {
				"bSortable" : false
			}, {
				"bSortable" : false
			}, {
				"bSortable" : false
			}, {
				"bSortable" : false
			}, {
				"bSortable" : false
			}, 
			]
		});
		

		var oTable1 = $('#sample-table-2').dataTable({
			"aoColumns" : [ {
				"bSortable" : false
			}, {
				"bSortable" : false
			}, {
				"bSortable" : false
			}, {
				"bSortable" : false
			},{
				"bSortable" : false
			}, {
				"bSortable" : false
			}, {
				"bSortable" : false
			}, {
				"bSortable" : false
			},{
				"bSortable" : false
			}, {
				"bSortable" : false
			}, {
				"bSortable" : false
			}, {
				"bSortable" : false
			},{
				"bSortable" : false
			}, {
				"bSortable" : false
			}, {
				"bSortable" : false
			}, {
				"bSortable" : false
			},{
				"bSortable" : false
			}, {
				"bSortable" : false
			}, {
				"bSortable" : false
			}, {
				"bSortable" : false
			}
			]
		});
		
		var oTable1 = $('#sample-table-3').dataTable({
			"aoColumns" : [ {
				"bSortable" : false
			}, {
				"bSortable" : false
			}, {
				"bSortable" : false
			}, {
				"bSortable" : false
			},{
				"bSortable" : false
			}, {
				"bSortable" : false
			}, {
				"bSortable" : false
			}, {
				"bSortable" : false
			}, {
				"bSortable" : false
			}, {
				"bSortable" : false
			}, {
				"bSortable" : false
			}, {
				"bSortable" : false
			}, {
				"bSortable" : false
			}, {
				"bSortable" : false
			}, {
				"bSortable" : false
			}, {
				"bSortable" : false
			}, {
				"bSortable" : false
			},  {
				"bSortable" : false
			}, {
				"bSortable" : false
			}, 
	
			]
		});
		
		var oTable1 = $('#sample-table-4').dataTable({
			"aoColumns" : [ {
				"bSortable" : false
			}, {
				"bSortable" : false
			}, {
				"bSortable" : false
			}, {
				"bSortable" : false
			},  {
				"bSortable" : false
			}, {
				"bSortable" : false
			},	{
				"bSortable" : false
			}, {
				"bSortable" : false
			}, {
				"bSortable" : false
			}, {
				"bSortable" : false
			}, {
				"bSortable" : false
			}, {
				"bSortable" : false
			}, {
				"bSortable" : false
			}, {
				"bSortable" : false
			}, {
				"bSortable" : false
			}, {
				"bSortable" : false
			}, {
				"bSortable" : false
			}, {
				"bSortable" : false
			}, {
				"bSortable" : false
			},  {
				"bSortable" : false
			}, 
	
			]
		});
		
		/* { "bSortable": false }
		 */
/*
		$('[data-rel="tooltip"]').tooltip({
			placement : tooltip_placement
		});
		function tooltip_placement(context, source) {
			var $source = $(source);
			var $parent = $source.closest('table')
			var off1 = $parent.offset();
			var w1 = $parent.width();

			var off2 = $source.offset();
			var w2 = $source.width();

			if (parseInt(off2.left) < parseInt(off1.left) + parseInt(w1 / 2))
				return 'right';
			return 'left';
		}
*/		
	});

	function formSubmit(device) {
		if(device =="pc") {
			var game = $('#selectGame').val();
			var platform = $('#platform').val();
			var channel = $('#channel').val();
			var statistics = $("input[name='form-field-radio3']:checked").val();		// 是否存储
			var startTime = $('#startTime').val();
			var endTime = $('#endTime').val();
		} else if(device =="move") {
			var game = $('#selectGame2').val();
			var platform = $('#platform2').val();
			var channel = $('#channel2').val();
			var statistics = $("input[name='form-field-radio32']:checked").val();		// 是否存储
			var startTime = $('#startTime2').val();
			var endTime = $('#endTime2').val();
		}
		
		if (!game || !startTime || !endTime) {
			alert('请将信息填写完整！');
		} else {
			
			if((channel && platform) || channel) {
				url = "index.php?mod=Data&do=fetchOperationToday&game="
					+ game
					+ "&channel="
					+ channel
					+ "&statistics="
					+ statistics
					+ "&startTime="
					+ startTime
					+ "&endTime="
					+ endTime;
			} else if(platform) {
				url = "index.php?mod=Data&do=fetchOperationToday&game="
					+ game
					+ "&platform="
					+ platform
					+ "&statistics="
					+ statistics
					+ "&startTime="
					+ startTime
					+ "&endTime="
					+ endTime;
				
			} else {
				url = "index.php?mod=Data&do=fetchOperationToday&game="
					+ game	
					+ "&statistics="
					+ statistics
					+ "&startTime="
					+ startTime
					+ "&endTime="
					+ endTime;
			}
			window.location.href = url;
		}
	}
	
	/**
	导出excel
	*/
	function formSubmitExportExcel(device) {
		if(device =="pc") {
			var game = $('#selectGame').val();
			var platform = $('#platform').val();
			var channel = $('#channel').val();
			var statistics = $("input[name='form-field-radio3']:checked").val();		// 是否存储
			var startTime = $('#startTime').val();
			var endTime = $('#endTime').val();
		} else if(device =="move") {
			var game = $('#selectGame2').val();
			var platform = $('#platform2').val();
			var channel = $('#channel2').val();
			var statistics = $("input[name='form-field-radio32']:checked").val();		// 是否存储
			var startTime = $('#startTime2').val();
			var endTime = $('#endTime2').val();
		}
		
		if (!game || !startTime || !endTime) {
			alert('请将信息填写完整！');
		} else {
			
			if((channel && platform) || channel) {
				url = "index.php?mod=Data&do=fetchOperationToday&game="
					+ game
					+ "&channel="
					+ channel
					+ "&statistics="
					+ statistics
					+ "&startTime="
					+ startTime
					+ "&endTime="
					+ endTime
					+ "&type=daochu";
			} else if(platform) {
				url = "index.php?mod=Data&do=fetchOperationToday&game="
					+ game
					+ "&platform="
					+ platform
					+ "&statistics="
					+ statistics
					+ "&startTime="
					+ startTime
					+ "&endTime="
					+ endTime
					+ "&type=daochu";
				
			} else {
				url = "index.php?mod=Data&do=fetchOperationToday&game="
					+ game	
					+ "&statistics="
					+ statistics
					+ "&startTime="
					+ startTime
					+ "&endTime="
					+ endTime
					+ "&type=daochu";
			}
			window.location.href = url;
		}
	}
	
	
	window.onload = function(){
		
		var width = document.documentElement.clientWidth;
		if(width < 1700) {
			$('#pcDevice').css("display", "none");
			$('#pcDevice2').css("display", "none");
			$('#moveDevice').css("display", "block");
			$('#moveDevice2').css("display", "block");
		} else if(width > 1700) {
			$('#pcDevice').css("display", "block");
			$('#pcDevice2').css("display", "block");
			$('#moveDevice').css("display", "none");
			$('#moveDevice2').css("display", "none");
		}
		
	    var select = document.getElementById('selectGame');
	    select.onchange = function(){
	    	
	        // 更改值后执行的代码
	       var gameName = jQuery("#selectGame  option:selected").text();
	       var _tagNum = 1;
	       $.ajax({
	    	    type: "POST",
				url: "index.php?mod=Game&do=getPlatformByGame&game=" + gameName,
				data: "",
				dataType: 'html',
				success: function(data) {					
					var dataObj = eval("(" + data + ")");//转换为json对象
					
					if(dataObj == null) {
						$("#platform").empty();
						$("#platform").append('<option value="" id="selectPlatform">平台</option>');
						$("#channel").empty();
						$("#channel").append('<option value="" id="selectChannel">渠道</option>');
					}
					
					var platform = dataObj.platform;
					$("#platform").empty();
					$("#platform").append('<option value="" id="selectPlatform">平台</option>');
					for(var i=0;i<platform.length;i++){
						$("#platform").append("<option value='"+platform[i]+"' >"+platform[i]+"</option>"+"<br/>");
					}
					
					var channel = dataObj.channel;
					$("#channel").empty();
					$("#channel").append('<option value="" id="selectChannel">渠道</option>');
					for(var i=0;i<channel.length;i++){
						$("#channel").append("<option value='"+channel[i]+"' >"+channel[i]+"</option>"+"<br/>");
					}
				}
	       });
	    }
	    
	    // 移动设备
	    var select2 = document.getElementById('selectGame2');
	    select2.onchange = function(){
	    	
	        // 更改值后执行的代码
	       var gameName = jQuery("#selectGame2  option:selected").text();
	       var _tagNum = 1;
	       $.ajax({
	    	    type: "POST",
				url: "index.php?mod=Game&do=getPlatformByGame&game=" + gameName,
				data: "",
				dataType: 'html',
				success: function(data) {					
					var dataObj = eval("(" + data + ")");//转换为json对象
					
					if(dataObj == null) {
						$("#platform2").empty();
						$("#platform2").append('<option value="" id="selectPlatform2">平台</option>');
						$("#channel2").empty();
						$("#channel2").append('<option value="" id="selectChannel2">渠道</option>');
					}
					
					var platform = dataObj.platform;
					$("#platform2").empty();
					$("#platform2").append('<option value="" id="selectPlatform2">平台</option>');
					for(var i=0;i<platform.length;i++){
						$("#platform2").append("<option value='"+platform[i]+"' >"+platform[i]+"</option>"+"<br/>");
					}
					
					var channel = dataObj.channel;
					$("#channel2").empty();
					$("#channel2").append('<option value="" id="selectChannel2">渠道</option>');
					for(var i=0;i<channel.length;i++){
						$("#channel2").append("<option value='"+channel[i]+"' >"+channel[i]+"</option>"+"<br/>");
					}
				}
	       });
	    }
	    
	} 
</script>

<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "footer.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
